/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package builders;

import entityclasses.Profile;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Vector;
import entityclasses.Share;
import entityclasses.Group;
import entityclasses.Person;
import entityclasses.Related;
import entityclasses.RelationshipStatus;
import factories.VectorFactory;

/**
 *
 * @author umutcan
 */
public class ProfileBuilder implements IProfileBuilder {

    private Profile profil = null;
    
    @Override
    public Profile getProfile()
    {
        if (profil == null)
            profil = new Profile();
        
            return profil;
    }
    @Override
    public void setProfileName(String profileName)
    {
        getProfile().setProfileName(profileName);
    }
    
    @Override
    public void setCreateDate() {
        
        Calendar currentDate = Calendar.getInstance();
        SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
        String dateNow = formatter.format(currentDate.getTime());
        getProfile().setCreateDate(dateNow);
        
    }
    
    @Override
    public void setFriends() {
        getProfile().setFriends(VectorFactory.createVector(Person.class));
    }
    
    @Override
    public void setFriendRequests() {
        getProfile().setFriendRequests(VectorFactory.createVector(Person.class));
    }
    
    @Override
    public void setGroups() {
        getProfile().setGroups(VectorFactory.createVector(Group.class));
    }
    
    @Override
    public void setRelationship(RelationshipStatus relationship) {
        getProfile().setRelationship(relationship);
    }    

    @Override
    public void setRelateds() {
        getProfile().setRelateds(VectorFactory.createVector(Related.class));
    }
    
    @Override
    public void setShares() {
        getProfile().setShares(new Vector<Share>());
    }    
    
}
